﻿<%@ Assembly Name="Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" Inherits="Microsoft.SharePoint.IdentityModel.Pages.FormsSignInPage"
    MasterPageFile="~/_layouts/simple.master" %>

<%@ Import Namespace="Microsoft.SharePoint.WebControls" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <SharePoint:EncodedLiteral runat="server" EncodeMethod="HtmlEncode" ID="ClaimsFormsPageTitle" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    <SharePoint:EncodedLiteral runat="server" EncodeMethod="HtmlEncode" ID="ClaimsFormsPageTitleInTitleArea" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderSiteName" runat="server" />
<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <div id="SslWarning" style="color: red; display: none">
        <SharePoint:EncodedLiteral runat="server" EncodeMethod="HtmlEncode" ID="ClaimsFormsPageMessage" />
    </div>
    <script language="javascript">
        if (document.location.protocol != 'https:') {
            var SslWarning = document.getElementById('SslWarning');
            SslWarning.style.display = '';
        }
    </script>
    <script type="text/C#" runat="server">
        protected HyperLink HyperLinkWinLogin;

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                if (Request["ReturnUrl"] != null)
                {
                    HyperLinkWinLogin = signInControl.FindControl("HyperLinkWinLogin") as HyperLink;

                    // Set return url to hyperlink so internal user can be redirected straight to where user was going.
                    string returnUrl = "ReturnUrl=" + Request["ReturnUrl"].ToString();

                    HyperLinkLoginWithVetuma.NavigateUrl += "&" + returnUrl;
                    HyperLinkToRegister.NavigateUrl += "&" + returnUrl;
                    HyperLinkWinLogin.NavigateUrl += returnUrl;
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message + " " + ex.StackTrace;

                SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    System.Diagnostics.EventLog.WriteEntry("Vetuma for SharePoint", message, System.Diagnostics.EventLogEntryType.Error);
                });
            }
        }
    </script>
    <asp:Login ID="signInControl" FailureText="<%$Resources:wss,login_pageFailureText%>"
        runat="server" Width="100%">
        <LayoutTemplate>
            <asp:Label ID="FailureText" class="ms-error" runat="server" />
            <table width="100%">
                <tr>
                    <td nowrap="nowrap">
                        <SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" Text="<%$Resources:wss,login_pageUserName%>"
                            EncodeMethod='HtmlEncode' />
                    </td>
                    <td width="100%">
                        <asp:TextBox ID="UserName" autocomplete="off" runat="server" class="ms-inputuserfield"
                            Width="99%" />
                    </td>
                </tr>
                <tr>
                    <td nowrap="nowrap">
                        <SharePoint:EncodedLiteral ID="EncodedLiteral2" runat="server" Text="<%$Resources:wss,login_pagePassword%>"
                            EncodeMethod='HtmlEncode' />
                    </td>
                    <td width="100%">
                        <asp:TextBox ID="password" TextMode="Password" autocomplete="off" runat="server"
                            class="ms-inputuserfield" Width="99%" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        <asp:Button ID="login" CommandName="Login" Text="<%$Resources:wss,login_pagetitle%>"
                            runat="server" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:CheckBox ID="RememberMe" Text="<%$SPHtmlEncodedResources:wss,login_pageRememberMe%>"
                            runat="server" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        <asp:HyperLink ID="HyperLinkWinLogin" runat="server" Text="<%$ Resources:VetumaForSP, InternalLogin %>"
                            NavigateUrl="~/_windows/default.aspx?"></asp:HyperLink>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <br />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:Login>
    <table class="ms-input">
        <tr>
            <td colspan="2">
                <asp:Label ID="Label1" runat="server" Width="400px" Text="<%$ Resources:VetumaForSP, VetumaInfo %>"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <br />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label2" runat="server" Font-Bold="true" Text="<%$ Resources:VetumaForSP, NoUserNameQuestion %>"></asp:Label>
            </td>
            <td>
                <asp:HyperLink ID="HyperLinkToRegister" runat="server" Text="<%$ Resources:VetumaForSP, Register %>"
                    NavigateUrl="~/_layouts/VetumaForSharePoint/VetumaRegister.aspx?auth=1"></asp:HyperLink>
                <asp:Image ID="Image1" runat="server" Height="14px" Style="vertical-align: bottom;"
                    ImageUrl="~/_layouts/images/HELPICON.GIF" ToolTip="<%$ Resources:VetumaForSP, NoUserNameQuestionHelp %>" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label4" runat="server" Font-Bold="true" Text="<%$ Resources:VetumaForSP, LoginWithVetumaQuestion %>"></asp:Label>
            </td>
            <td>
                <asp:HyperLink ID="HyperLinkLoginWithVetuma" runat="server" Text="<%$ Resources:VetumaForSP, LoginWithVetuma %>"
                    NavigateUrl="~/_layouts/VetumaForSharePoint/VetumaRegister.aspx?auth=1&loginMethod=1"></asp:HyperLink>
                <asp:Image ID="Image2" runat="server" Height="14px" Style="vertical-align: bottom;"
                    ImageUrl="~/_layouts/images/HELPICON.GIF" ToolTip="<%$ Resources:VetumaForSP, LoginWithVetumaQuestionHelp %>" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label5" runat="server" Font-Bold="true" Text="<%$ Resources:VetumaForSP, ForgotPasswordQuestion %>"></asp:Label>
            </td>
            <td>
                <asp:HyperLink ID="HyperLinkGetNewPassword" runat="server" Text="<%$ Resources:VetumaForSP, GetNewPassword %>"
                    NavigateUrl="~/_layouts/VetumaForSharePoint/VetumaPasswordRecovery.aspx?auth=1&recoveryCase=2"></asp:HyperLink>
                <asp:Image ID="Image3" runat="server" Height="14px" Style="vertical-align: bottom;"
                    ImageUrl="~/_layouts/images/HELPICON.GIF" ToolTip="<%$ Resources:VetumaForSP, ForgotPasswordQuestionHelp %>" />
            </td>
        </tr>
    </table>
</asp:Content>
